When a computer Central Processing Unit (“CPU”) is executing an application, the CPU needs access to the application's program instructions and data, which are generally stored in a persistent storage device, such as the hard drive of a single computer or in storage units connected to networked systems. The term “disk” is used in this patent to refer generally to any persistent storage device. Retrieving instructions and data from a disk takes a long time in terms of processing, and if the CPU had to retrieve instructions and data from a disk each time they were needed, computers would not run efficiently. Therefore, most modern computing systems include high-speed system memory, usually implemented using solid-state random access memory (RAM) components. Program instructions and data are copied into the memory, so that they do not need to be retrieved from disk when they are needed by the CPU.
System memory is divided into segments usually referred to as “memory pages.” A page is a block of main memory that is contiguous. A page is a unit of instructions and/or data that is transferred between the disk and memory, and usually the smallest unit of data for which the operating system allocates memory.
Many modern computer systems also include virtual memory as is well understood in the art of computer software. Virtual memory is an abstraction that allows for system memory to appear larger than it is, making retrieval of instructions and data more efficient. Virtual memory allows for a page that does not currently reside in main memory to be addressed as if it did. Virtual memory is implemented by creating virtual memory addresses for pages and then using a page table, i.e. a data structure that maps each page in “virtual memory” to a physical location, which may be in memory or on a disk. Virtual page numbers (“VPNs”) are often saved in the page table to indicate the virtual address. For example, when a “context” is loaded into memory, some of pages may be given virtual memory addresses even though the pages have not yet been loaded into system memory. The page table will map the virtual address of the page to its location on the disk. The term “context” is used in this patent to refer to any software or hardware component, device or system that addresses and reads from the hardware memory and that has its own address translation (mapping) state. For a traditional OS, the term “context” includes a “process” or an “application” that has an address space and associated page table that contains information about how to map virtual pages to physical pages and other page-level information. For a virtualized system, which is described in more detail below, the term “context” would also include a virtual machine (“VM”).
FIG. 1 is a diagram illustrating an example of a page table 100 mapping virtual pages VPN 1 110, VPN 2 112, VPN 3 114, and VPN 4 116 for a context to an indication of their location in either in system memory 102 or on disk 104. (The numbers 1-4 are used to refer to the virtual pages and are not meant to be examples of actual VPNs.) Arrows 120, 122, 124 and 126, are used to illustrate the indication of the page's location that is saved in column 106. When a page has been loaded into system memory, the indication of its location may be a physical page number “PPN,” which can be used to determine the page's address in system memory. When the page has not yet been loaded into system memory, the indication shown in column 106 may be the page's address on the hard disk. As shown, VPN 1 110 is mapped to system memory page 132 by 120, and VPN 2 112 is mapped to system memory page 130 by 122. VPN 3 114 is mapped to the page on disk 140 by 124, and VPN 4 116 is mapped to a page on disk 142 by 126.
Virtual memory also may use an area on the disk referred to as “swap” or the “swap file” to temporarily store memory pages that have already been loaded into memory or pages that have been recently created and have not yet been stored in a permanent disk location. Some of the pages in swap may be permanently stored on disk at a later time, and some may just be cleaned once the program exits, such as pages allocated to a process for runtime data such as heap allocations. When memory is becoming full, the operating system may move a page to swap to make room for more pages to be loaded into system memory. In some cases, reloading the page from swap is more efficient than reloading it from its original disk location. In FIGS. 1, 140 and 142 are meant to illustrate either disk locations where pages are permanently stored in memory or pages temporarily stored in swap.
Virtual memory works by generating an exception, called a page fault, if a program tries to access a “virtual page” that is not in memory. The hardware or operating system is notified and loads the required page from the disk into system memory. The context which addressed the memory has no knowledge of the page fault or the process following it, thereby allowing a context to address more (virtual) system memory than physically exists in the computer. Memory pages consist of a series of bits that are the current content of that page. Due to variety of reasons, such as cosmic radiation, etc., these bits may spontaneously change their value, thereby corrupting the content of the page. These corruptions are often referred to as bit-errors.
The overall resources available in each server, such as CPU cores and memory capacity have been growing very rapidly. With the rapid increase in memory capacity per server, the probability of multi-bit errors occurring in memory has grown as well. Therefore, there is a higher likelihood that there may one or more multi-bit errors of arbitrary length on a memory page. There are two types of errors in memory: persistent and non-persistent (transient) errors. A persistent error denotes a permanent fault in memory hardware, such that the hardware will continue to corrupt a bit each time it is used. A transient error is one that happens just once and is often attributed to a cosmic ray collision as high-energy particles striking a memory chip can disturb the state of the RAM and cause the corruption. When either a persistent or non-persistent multi-bit error occurs, the operating system may panic (or “crash”) the entire system, affecting all of the services that may be running on that host. If the error is ignored without any corrective action, there is a risk that user data will be corrupted or the system will otherwise operate incorrectly.